package factory;

import influence_radii.Angular;
import influence_radii.InfluenceRadius;
import influence_radii.Linear;
import influence_radii.MeteorShower;
import influence_radii.Radial;

import java.util.HashMap;
import java.util.Map;

public class InfluenceRadiusFactory {
	public static Map<String, InfluenceRadius> iRMappings = new HashMap<String, InfluenceRadius>();
	
	/**
	 * create and populate the static map
	 */
	static {
		iRMappings.put("Radial", new Radial());
		iRMappings.put("Angular", new Angular());
		iRMappings.put("Linear", new Linear());
		iRMappings.put("MeteorShower", new MeteorShower());
	}
	
	/**
	 * return an InfluenceRadius based on the passed in String
	 * @param type
	 * @return
	 */
	public static InfluenceRadius createInfluenceRadius(String type) {
		return iRMappings.get(type);
	}

}
